
#ifndef _MEMBER_BFILEDIALOG_H_
#define _MEMBER_BFILEDIALOG_H_

#include <BMap>
#include <BClock>
#include <BPoint>
#include <BLine2>
#include <BString>
#include <BFolder>
#include <BLabel>
#include <BButton>
#include <BLineEdit>
#include <BTreeWidget>
#include <BListWidget>
#include <BTableWidget>
#include <BTableItem>
#include <BScrollBar>
#include <BComboBox>
#include <BHBoxLayout>
#include <BVBoxLayout>
#include <BSplitter>
#include <BFileDialog>
#include <BImage>

namespace BWE
{
	class member_BFileDialog : public BObject
	{
	public:
		member_BFileDialog(BFileDialog* fileDialog);
		~member_BFileDialog();

		BString typeName(BEntry* entry);
		BImage* imageOf(BObject* object);

		void resetTreeWidget();
		void freshTreeItemImage(BTreeItem* item);
		void freshTableItemImage();

		bool locate(const BString& path);

		void expandFolderItem(BTreeItem* folderItem);
		void openFolder(const BString& path);

		void procPathChanged(BObject* object, const BValue& value);
		void procExpandFolder(BObject* object, const BValue& value);
		void procOpenFolder(BObject* object, const BValue& value);
		void procFileClicked(BObject* object, const BValue& value);
		void procFileDoubleClicked(BObject* object, const BValue& value);
		void procFileNameEdited(BObject* object);
		void procOkClicked();
		void procCancleClicked();

		BFileDialog*		boss;
		BFolder::Filter		filter;
		bool				dirty;
		bool				dirtyStyle;
		BString				nameFilter;
		SelectMode			selectMode;
		BStringList			fileNames;
		BButton*			backButton;
		BButton*			frontButton;
		BButton*			aboveButton;
		BComboBox*			pathComboBox;
		BComboBox*			searchComboBox;
		BTreeWidget*		treeWidget;
		BTableWidget*		tableWidget;
		BLineEdit*			fileNameEdit;
		BButton*			okButton;
		BButton*			cancleButton;
		const BStyle*		style;
	};
}

#endif